<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	 
	 public function __construct()
    {
   	parent::__construct();
   	//$this->load->library('session');
	 	$this->load->helper(array('url','file','xml2array'));
    }
	 
	 
	public function index()
	{	
		$jsfiles=array("main.js");
		$cssfiles=array("main.css");
		$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
		$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title);
		$this->load->view('templates/header',$data);
		$this->load->view('indexpage.php');
		$this->load->view('templates/footer');
		//$this->load->view('welcome_message');
	}
	
	public function pg_home()
	{
		$jsfiles=array("main.js");
		$cssfiles=array("main.css");
		$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
		$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title);
		$this->load->view('templates/header',$data);
		$this->load->view('indexpage.php');
		$this->load->view('templates/footer');
		}
	
		public function pg_projects()
		{
			$jsfiles=array("main.js");
			$cssfiles=array("main.css");
			$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
			$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title);
			$this->load->view('templates/header',$data);
			$this->load->view('projects_list.php');
			$this->load->view('templates/footer');
			}
	
		public function pg_contact()
		{
			$jsfiles=array("main.js");
			$cssfiles=array("main.css");
			$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
			$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title);
			$this->load->view('templates/header',$data);
			$this->load->view('contact.php');
			$this->load->view('templates/footer');
		}
	
		public function pg_members()
		{
			$jsfiles=array("main.js");
			$cssfiles=array("main.css");
			$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
			$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title);
			$this->load->view('templates/header',$data);
			$this->load->view('members.php');
			$this->load->view('templates/footer');
		}
		
		public function pg_publications()
		{
			$jsfiles=array("main.js");
			$cssfiles=array("main.css");
			$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
			$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title);
			$this->load->view('templates/header',$data);
			$this->load->view('publications.php');
			$this->load->view('templates/footer');
		}
	
		public function pg_members_details()
		{
			$jsfiles=array("main.js");
			$cssfiles=array("main.css");
			$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
			$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title);
			$this->load->view('templates/header',$data);
			$this->load->view('members_details.php');
			$this->load->view('templates/footer');
		}
		
		public function pg_project_item($item_id)
		{
			$jsfiles=array("main.js");
			$cssfiles=array("main.css");
			$title='Welcome to Computer Vision Lab of Center for Pattern Analysis and Machine Intelligence';
			
			
			$pro_inform_stream=read_file('./extern/project_items.xml');
			$pro_inform_array=xml2array($pro_inform_stream);
			$pro_item=$pro_inform_array['projects']['project_item'][$item_id];
			if(isset($pro_item) && $pro_item!=NULL){
				$pro_title=$pro_item['title'];
				$pro_image=$pro_item['image'];
				$pro_intro='';
				foreach($pro_item['intro']['p'] as $param)
					$pro_intro=$pro_intro.'<p>'.$param.'</p>';
				$pro_publication=$pro_item['publication'];
			}
			
			// $pro_title='Recognition: Objects, Faces';
			// $pro_image='images/projects/margritti-this-is-not-a-pipe.jpg';
			//$pro_intro='<p>In order to survive, an animal has to understand the environment it is in, learning to spot both predator and prey, spot navigational obstacles and so on. Detecting and recognizing objects is thus one of the most important uses of vision systems in nature, and is consequently highly evolved. Indeed, humans can distinguish between more than 30,000 visual categories, and can detect objects in the span of a few hundred milliseconds.</p><p>Although we are nowhere near human performance in this task, we have made considerable progress in the past few years. Our work focusses on building object detection systems that can work "in the wild", in the presence of heavy occlusion and drastic appearance changes. We work on a large variety of systems, ranging from those based on sliding window-based detectors to those powered by regions from bottom up segmentation. Along the way our research has also yielded better feature descriptors, and better and more efficient machine learning algorithms.</p><p>Object detection is hardly the end goal, and keeping that in mind, we also focus on finer grained tasks, such as segmenting out the pixels associated with the objects, or inferring its pose and other attributes.</p>';
			// $pro_publication=array(
				// array('pub_img'=>'images/projects/pub_1.png'
					// ,'pub_title'=>'Multi-Component Models for Object Detection'
					// ,'pub_authors'=>'C. Gu, P. Arbelaez, Y. Lin, K. Yu, and J. Malik'
					// ,'pub_publisher'=>'ECCV 2012'
					// ,'pub_pdf'=>'papers/galym_eccv2012.pdf'
					// //,'pub_project'=>'http://pami.xmu.edu.cn'
				// )
				// ,array('pub_img'=>'images/projects/pub_2.png'
					// ,'pub_title'=>'Discriminative Decorrelation for Clustering and Classification'
					// ,'pub_authors'=>'B. Hariharan, J. Malik, D. Ramanan'
					// ,'pub_publisher'=>'ECCV 2012'
					// //,'pub_pdf'=>'papers/galym_eccv2012.pdf'
					// //,'pub_project'=>'http://pami.xmu.edu.cn'
				// )
			// );
			
			$data=array('jsfiles'=>$jsfiles,'cssfiles'=>$cssfiles,'title'=>$title,'pro_title'=>$pro_title,'pro_image'=>$pro_image,'pro_intro'=>$pro_intro,'pro_publication'=>$pro_publication);
			$this->load->view('templates/header',$data);
			$this->load->view('project_item.php');
			$this->load->view('templates/footer');
		}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */